import 'package:flutter/material.dart';

class ContainerComp extends StatelessWidget {
  const ContainerComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      // 宽高占满
      width: double.infinity,
      height: double.infinity,
      // 子组件对齐方式
      alignment: Alignment.center,
      // padding: const EdgeInsets.all(20),
      padding: const EdgeInsets.only(top: 20, bottom: 20),
      // padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
      // padding: const EdgeInsets.fromLTRB(20, 15, 5, 10),
      margin: const EdgeInsets.all(20),
      decoration: BoxDecoration(
          // 背景色
          color: Colors.yellow,
          // 边框
          border: Border.all(color: Colors.red, width: 2),
          // 圆角
          borderRadius: const BorderRadius.only(
              topLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
          // 阴影
          boxShadow: const [
            BoxShadow(color: Colors.black, offset: Offset(2, 2), blurRadius: 5),
            BoxShadow(
                color: Colors.grey, offset: Offset(-2, -2), blurRadius: 5),
            BoxShadow(
                color: Colors.redAccent, offset: Offset(2, -2), blurRadius: 5),
          ],
          // 渐变
          gradient: const LinearGradient(colors: [
            Colors.red,
            Colors.yellow,
            Colors.blue,
          ], begin: Alignment.topLeft, end: Alignment.bottomRight)),
      child: const Text('我是ContainerComp组件'),
    );
  }
}
